In 1939, Daguerre in France invented the first camera in the world, it dramatically changed the way to record people's life. With the development of electron-optical technology, photos taken for landscape, portrait and animal evolve from black-and-white to colorized and become more clear and vivid.
According to one technique, an active focusing approach is disclosed, which is primary used for traditional camera. According to another technique, a passive focusing approach is disclosed, which is popular for mobile phones and tablets. Furthermore, there are three approaches for a contrast detection method in passive focusing.
The first approach is a global ramping algorithm as shown in FIG. 1, in which focus values are compared one by one and a maximum focus value is determined after all the focus values have been compared, so as to drive a focus motor to implement focusing. The second approach is a fast ramping algorithm as shown in FIG. 2, in which once a maximum value is obtained through comparison, i.e., a current focus value is smaller than a previous focus value, a maximum focus value is obtained, and the comparison will no longer continue. The third approach is a global stepwise ramping algorithm as shown in FIG. 3, in which a ramping algorithm is executed respectively in steps based on Depth of Field (DOF), a representative node is selected in the same range of DOF, and focus values of various representative nodes are compared to obtain a maximum focus value.
However, the calculation time is long and the calculation speed is low for the above three focusing manners, which is difficult to meet users' requirements on quick focusing. Therefore, the time required to focus using the contrast detection method is long.